package com.cn.thread;

import com.cn.thread.blocking.BlockingBufferResources;
import com.cn.thread.common.BufferResources;
import com.cn.thread.common.Consumer;
import com.cn.thread.common.Producer;

public class TestProduceConsumer {

    public static void main(String[] args) {
        BufferResources bufferResources = new BlockingBufferResources();
        //十个生产者线程
        for (int i = 0; i < 10; i++) {
            new Producer(bufferResources).start();
        }
        //十个消费者线程
        for (int i = 0; i < 10; i++) {
            new Consumer(bufferResources).start();
        }

    }

}
